﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="html" indent="yes"/>
  <xsl:variable name="formatdec" select="'#.00'"/>
    <xsl:template match="/"> 
      <html>
        <head>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
          <title>
            StressTester Report
          </title>
        </head>
        <body>
        <xsl:apply-templates select="testresult"/>
        </body>
      </html>
    </xsl:template>
  <xsl:template match ="testresult">
    <div id="testname"><xsl:value-of select="test/name"/></div>
    <table>
      <tr>
        <td>
          <table class="datatable">
            <tr>
              <td class="datacaption">Number of clients executing test</td>
              <td>TBD</td>
            </tr>
            <tr>
              <td class="datacaption">Number of threads per client</td>
              <td class="data">
                <xsl:value-of select="test/testthreadcount"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Times the test was repeated:</td>
              <td class="data">
                <xsl:value-of select="test/timestorepeat"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Pause between queries</td>
              <td class="data">
                <xsl:value-of select="test/timebetweenqueries/from div 1000"/>-<xsl:value-of select="test/timebetweenqueries/to div 1000"/> secs
              </td>
            </tr>
            <tr>
              <td class="datacaption">Query pick mode</td>
              <td class="data">
                TBD
              </td>
            </tr>
            <tr>
              <td class="datacaption">Total number of queries</td>
              <td class="data">
                TBD
              </td>
            </tr>
            <tr>
              <td class="datacaption">Number of distinct queries</td>
              <td class="data">
                TBD
              </td>
            </tr>
            <tr>
              <td class="datacaption">Queries per client</td>
              <td class="data">
                TBD
              </td>
            </tr>
          </table>         
        </td>
        <td>
          <table class="datatable">
            <tr>
              <td class="datacaption">Test started</td>
              <td class="data">
                <xsl:value-of select="started"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Test ended</td>
              <td class="data">
                <xsl:value-of select="ended"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Total test duration</td>
              <td class="data">
                <xsl:value-of select="format-number(duration, $formatdec)"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Queries issued per second</td>
              <td class="data">
                <xsl:value-of select="format-number(summarydurations/queriespersecond, $formatdec)"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Number of failed queries</td>
              <td class="data">
                TBD
              </td>
            </tr>
            <tr>
              <td class="datacaption">Fastest query</td>
              <td class="data">
                <xsl:value-of select="format-number(summarydurations/minduration div 1000, $formatdec)"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Slowest query</td>
              <td class="data">
                <xsl:value-of select="format-number(summarydurations/maxduration div 1000, $formatdec)"/>
              </td>
            </tr>
            <tr>
              <td class="datacaption">Average query</td>
              <td class="data">
                <xsl:value-of select="format-number(summarydurations/avgduration div 1000, $formatdec)"/>
              </td>
            </tr>
          </table>         
        </td>
      </tr>
    </table>
    <div class="dataheader">General test information / configuration </div>

    <div class="dataheader">General execution information</div>

    <div class="dataheader">Query breakdown</div>
    <div class="dataheader">Client breakdown</div>
  </xsl:template>
</xsl:stylesheet>
